<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class cetak extends CI_Controller {

    public function __construct() {
        parent::__construct();

        $this->load->library('auth');
        $this->load->library('base');
        $this->load->library('ajaxresponse');
        $this->load->model("report/m_potongan");
        $this->load->model("crud/m_info_usaha");
    }

    function index() {
        $this->auth->is_logged_in('form/login');
        $this->base->head_html('Laporan Potongan');
        $this->load->view('pengurus/br-08/potongan');
    }

    function anggota_rencana()
    {
        $this->auth->is_logged_in('form/login');
        $this->base->head_html('Laporan Rencana Potongan Anggota');
        $this->load->view('pengurus/br-08/rencana_potongan');
    }

    function cetak_rencana($id_anggota)
    {
        $this->load->helper('dompdf');
        $this->load->helper('file');
        
        $data["rencana_potongan"] = $this->m_potongan->get_active($id_anggota)->result();
        $data['info_usaha'] = $this->m_info_usaha->get()->result();

        $data['title'] = "Just a test";
        $this->load->view('report/rencana_potongan_anggota', $data);
        //$html = $this->load->view('report/rencana_potongan_anggota', $data, true);
        //pdf_create($html, 'PJM_' . $data['Pinjam']->NAMA_ANGGOTA . '_' . $data['Pinjam']->ID_PINJAMAN);
    }


}
?>
